package com.zxk.blog.controller;

import com.zxk.core.common.constant.CodeMsg;
import com.zxk.core.common.util.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Description TODO
 * @Author zxk
 * @DATE 2022/11/24 15:50
 * @Version 1.0
 **/
//@ControllerAdvice
public class MyControllerAdvice {

    @ExceptionHandler({Exception.class})
    public R exceptionHandle(Exception e) {
//        e.printStackTrace();
        return R.error(CodeMsg.COMMON_ERROR.getCode(),CodeMsg.COMMON_ERROR.getReason());
    }
}
